﻿<ResourceDictionary x:Class="WPFCABShell.$safeprojectname$.DefaultSkin"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:con="http://schemas.kent.boogaart.com/converters"
	xmlns:local="clr-namespace:WPFCABShell.$safeprojectname$"
	xmlns:sys="clr-namespace:System;assembly=mscorlib"
	xmlns:modules="clr-namespace:WPFCABShell.$safeprojectname$.Interface.Services.Module;assembly=$safeprojectname$.Interface">

	<con:MapConverter x:Key="ModuleStatusConverter">
		<con:Mapping From="{x:Static modules:ModuleStatus.Loaded}" To="Loaded"/>
		<con:Mapping From="{x:Static modules:ModuleStatus.NotLoaded}" To="Not loaded"/>
	</con:MapConverter>
	
	<Style TargetType="GridSplitter">
		<Style.Triggers>
			<Trigger Property="VerticalAlignment" Value="Stretch">
				<Setter Property="Width" Value="3"/>
			</Trigger>
			<Trigger Property="HorizontalAlignment" Value="Stretch">
				<Setter Property="Height" Value="3"/>
			</Trigger>
		</Style.Triggers>
	</Style>

	<Style TargetType="Button">
		<Setter Property="Margin" Value="3"/>
		<Setter Property="MinWidth" Value="80"/>
		<Setter Property="MinHeight" Value="25"/>
	</Style>

	<Style TargetType="{x:Type StatusBarItem}">
		<Setter Property="Height" Value="23"/>
	</Style>

	<Style TargetType="{x:Type CheckBox}">
		<Setter Property="Margin" Value="3"/>
	</Style>
	
	<Style TargetType="{x:Type MenuItem}">
		<Setter Property="MaxHeight" Value="23"/>
	</Style>
	
	<Style TargetType="{x:Type ListView}">
		<!-- ensure items in list views stretch to fit the width of the column in which they're contained -->
		<Setter Property="ItemContainerStyle">
			<Setter.Value>
				<Style TargetType="{x:Type ListViewItem}">
					<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
				</Style>
			</Setter.Value>
		</Setter>
	</Style>

	<Style x:Key="{x:Static ToolBar.ButtonStyleKey}" TargetType="Button" BasedOn="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
		<Setter Property="MaxHeight" Value="25"/>
	</Style>

	<Style TargetType="ProgressBar">
		<Setter Property="MinWidth" Value="100"/>
		<Setter Property="MinHeight" Value="20"/>
	</Style>

	<Style x:Key="PluginsItemsControlStyle" TargetType="{x:Type ItemsControl}">
		<Setter Property="ItemTemplateSelector" Value="{StaticResource PluginItemTemplateSelector}"/>
	</Style>

	<StackPanel x:Key="PluginsItemsControlHeaderContent" x:Shared="False" Background="{x:Static SystemColors.ControlLightBrush}" TextElement.Foreground="{x:Static SystemColors.ControlTextBrush}">
		<StackPanel.Resources>
			<con:MapConverter x:Key="PluginGroupNameConverter">
				<con:Mapping To="Trusted Plugins">
					<con:Mapping.From>
						<sys:Boolean>True</sys:Boolean>
					</con:Mapping.From>
				</con:Mapping>
				<con:Mapping To="Untrusted Plugins">
					<con:Mapping.From>
						<sys:Boolean>False</sys:Boolean>
					</con:Mapping.From>
				</con:Mapping>
			</con:MapConverter>

			<con:MapConverter x:Key="PluginGroupDescriptionConverter">
				<con:Mapping To="These plugins are implicitly trusted. Therefore, they are always loaded when found.">
					<con:Mapping.From>
						<sys:Boolean>True</sys:Boolean>
					</con:Mapping.From>
				</con:Mapping>
				<con:Mapping To="These plugins are not implicitly trusted. You must check these plugins in order to acknowledge that you trust them and want them to be loaded.">
					<con:Mapping.From>
						<sys:Boolean>False</sys:Boolean>
					</con:Mapping.From>
				</con:Mapping>
			</con:MapConverter>
		</StackPanel.Resources>

		<StackPanel Margin="3">
			<ContentControl>
				<Bold>
					<TextBlock FontSize="14" Text="{Binding Name, Converter={StaticResource PluginGroupNameConverter}}"/></Bold>
			</ContentControl>
			<ContentControl>
				<TextBlock FontSize="13" Margin="5 0 0 0" Text="{Binding Name, Converter={StaticResource PluginGroupDescriptionConverter}}" TextWrapping="Wrap"/></ContentControl>
		</StackPanel>
	</StackPanel>

	<DataTemplate x:Key="TrustedPluginDataTemplate">
		<Grid>
			<Grid.Resources>
				<Style TargetType="{x:Type TextBlock}">
					<Setter Property="Margin" Value="3"/>
				</Style>
			</Grid.Resources>
			
			<Grid.RowDefinitions>
				<RowDefinition Height="Auto"/>
				<RowDefinition Height="Auto"/>
				<RowDefinition Height="Auto"/>
			</Grid.RowDefinitions>
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="20"/>
				<ColumnDefinition Width="Auto"/>
				<ColumnDefinition Width="*"/>
			</Grid.ColumnDefinitions>

			<TextBlock Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Text="{Binding Name, Converter={con:FormatConverter {}{0}:}}"/>
			<TextBlock Grid.Row="0" Grid.Column="2" Text="{Binding Description}" TextTrimming="CharacterEllipsis"/>

			<TextBlock Grid.Row="1" Grid.Column="1">Path:</TextBlock>
			<TextBlock Grid.Row="1" Grid.Column="2" Text="{Binding Path}" TextTrimming="CharacterEllipsis"/>

			<TextBlock Grid.Row="2" Grid.Column="1">Version:</TextBlock>
			<TextBlock Grid.Row="2" Grid.Column="2" Text="{Binding Version}" TextTrimming="CharacterEllipsis"/>
		</Grid>
	</DataTemplate>

	<DataTemplate x:Key="UntrustedPluginDataTemplate">
		<Grid>
			<Grid.Resources>
				<Style TargetType="{x:Type CheckBox}">
					<Setter Property="Margin" Value="3"/>
				</Style>
				
				<Style TargetType="{x:Type TextBlock}">
					<Setter Property="Margin" Value="3"/>
				</Style>
			</Grid.Resources>
			
			<Grid.RowDefinitions>
				<RowDefinition Height="Auto"/>
				<RowDefinition Height="Auto"/>
				<RowDefinition Height="Auto"/>
				<RowDefinition Height="Auto"/>
			</Grid.RowDefinitions>
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="20"/>
				<ColumnDefinition Width="Auto"/>
				<ColumnDefinition Width="*"/>
			</Grid.ColumnDefinitions>

			<StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Orientation="Horizontal">
				<CheckBox IsChecked="{Binding IsWhitelisted}">
					<TextBlock Text="{Binding Name, Converter={con:FormatConverter {}{0}:}}" Margin="0"/>
				</CheckBox>
			</StackPanel>
			<TextBlock Grid.Row="0" Grid.Column="2" Text="{Binding Description}" TextTrimming="CharacterEllipsis"/>

			<TextBlock Grid.Row="1" Grid.Column="1">Path:</TextBlock>
			<TextBlock Grid.Row="1" Grid.Column="2" Text="{Binding Path}" TextTrimming="CharacterEllipsis"/>

			<TextBlock Grid.Row="2" Grid.Column="1">Version:</TextBlock>
			<TextBlock Grid.Row="2" Grid.Column="2" Text="{Binding Version}" TextTrimming="CharacterEllipsis"/>

			<TextBlock Grid.Row="3" Grid.Column="1">Status:</TextBlock>
			<TextBlock Grid.Row="3" Grid.Column="2" TextTrimming="CharacterEllipsis">
				<TextBlock.Text>
					<Binding Path="ModuleStatus" Converter="{StaticResource ModuleStatusConverter}"/>
				</TextBlock.Text>
			</TextBlock>
		</Grid>
	</DataTemplate>

	<DataTemplate x:Key="ShortcutTemplate">
		<TextBlock>
			<Hyperlink Command="{Binding Command}">
				<TextBlock Text="{Binding Command.Text}"/>
			</Hyperlink>
		</TextBlock>
	</DataTemplate>

	<DrawingImage x:Key="Undo">
		<DrawingImage.Drawing>
			<DrawingGroup>
				<DrawingGroup.Children>
					<GeometryDrawing Brush="#ff7e7e7e" Geometry="F1 M 51.351563,43.402832 C 37.662109,13.375000 14.479004,20.440430 14.258301,20.440430 L 14.258301,30.375977 L 0.900391,14.368652 L 14.368652,0.900391 L 14.368652,10.946289 C 14.368652,10.946289 46.494141,3.439453 51.351563,43.402832 Z">
						<GeometryDrawing.Pen>
							<Pen DashCap="Flat" Thickness="1.800910" Brush="#ff323232" StartLineCap="Round" EndLineCap="Round" LineJoin="Round"/>
						</GeometryDrawing.Pen>
					</GeometryDrawing>
				</DrawingGroup.Children>
			</DrawingGroup>
		</DrawingImage.Drawing>
	</DrawingImage>

	<DrawingImage x:Key="Redo">
		<DrawingImage.Drawing>
			<DrawingGroup>
				<DrawingGroup.Children>
					<GeometryDrawing Brush="#ff7e7e7e" Geometry="F1 M 0.900391,0.900391 C 14.589844,30.928223 37.772949,23.862793 37.993652,23.862793 L 37.993652,13.927246 L 51.351563,29.934570 L 37.883301,43.402832 L 37.883301,33.356934 C 37.883301,33.356934 5.757813,40.863770 0.900391,0.900391 Z">
						<GeometryDrawing.Pen>
							<Pen DashCap="Flat" Thickness="1.800910" Brush="#ff323232" StartLineCap="Round" EndLineCap="Round" LineJoin="Round"/>
						</GeometryDrawing.Pen>
					</GeometryDrawing>
				</DrawingGroup.Children>
			</DrawingGroup>
		</DrawingImage.Drawing>
	</DrawingImage>

	<DrawingImage x:Key="Cut">
		<DrawingImage.Drawing>
			<DrawingGroup>
				<DrawingGroup.Children>
					<GeometryDrawing Brush="#ffcbcbcb" Geometry="F1 M 4.098145,1.562500 C 2.698730,1.562500 1.562500,2.698242 1.562500,4.097656 L 1.562500,36.305664 C 1.562500,37.704590 2.698730,38.840820 4.098145,38.840820 L 17.015625,38.840820 L 17.015625,19.996094 C 17.015625,18.596680 18.151855,17.460449 19.550781,17.460449 L 36.991211,17.460449 L 36.991211,4.097656 C 36.991211,2.698242 35.889160,1.562500 34.489746,1.562500 L 4.098145,1.562500 Z">
						<GeometryDrawing.Pen>
							<Pen DashCap="Flat" Thickness="3.125000" Brush="#ff4b4b4b" StartLineCap="Round" EndLineCap="Round" LineJoin="Round"/>
						</GeometryDrawing.Pen>
					</GeometryDrawing>
					<GeometryDrawing Brush="#ffb2b2b2" Geometry="F1 M 36.344727,32.727539 C 34.945313,32.727539 33.809082,33.863770 33.809082,35.262695 L 33.809082,54.107910 L 33.809082,54.484863 L 51.215332,54.484863 C 52.614258,54.484863 53.716309,53.348633 53.716309,51.949219 L 53.716309,32.727539 L 36.344727,32.727539 Z">
						<GeometryDrawing.Pen>
							<Pen DashCap="Flat" Thickness="3.125000" Brush="#ff4b4b4b" StartLineCap="Round" EndLineCap="Round" LineJoin="Round"/>
						</GeometryDrawing.Pen>
					</GeometryDrawing>
					<GeometryDrawing Brush="#ff7e7e7e" Geometry="F1 M 7.611328,19.832520 C 16.260742,38.806152 30.909668,34.341797 31.049316,34.341797 L 31.049316,28.063477 L 39.489746,38.178223 L 30.979492,46.688477 L 30.979492,40.340820 C 30.979492,40.340820 10.680664,45.083984 7.611328,19.832520 Z">
						<GeometryDrawing.Pen>
							<Pen DashCap="Flat" Thickness="3.125000" Brush="#ff323232" StartLineCap="Round" EndLineCap="Round" LineJoin="Round"/>
						</GeometryDrawing.Pen>
					</GeometryDrawing>
				</DrawingGroup.Children>
			</DrawingGroup>
		</DrawingImage.Drawing>
	</DrawingImage>

	<DrawingImage x:Key="Copy">
		<DrawingImage.Drawing>
			<DrawingGroup>
				<DrawingGroup.Children>
					<GeometryDrawing Brush="#ffcbcbcb" Geometry="F1 M 4.037109,1.562500 L 33.819824,1.562500 C 35.186035,1.562500 36.293945,2.670410 36.293945,4.037109 L 36.293945,35.601074 C 36.293945,36.967285 35.186035,38.075195 33.819824,38.075195 L 4.037109,38.075195 C 2.670410,38.075195 1.562500,36.967285 1.562500,35.601074 L 1.562500,4.037109 C 1.562500,2.670410 2.670410,1.562500 4.037109,1.562500 Z">
						<GeometryDrawing.Pen>
							<Pen DashCap="Flat" Thickness="3.125000" Brush="#ff4b4b4b" LineJoin="Round"/>
						</GeometryDrawing.Pen>
					</GeometryDrawing>
					<GeometryDrawing Brush="#ffb2b2b2" Geometry="F1 M 19.176270,17.146973 L 48.958984,17.146973 C 50.325684,17.146973 51.433594,18.255371 51.433594,19.621582 L 51.433594,51.185547 C 51.433594,52.552246 50.325684,53.660156 48.958984,53.660156 L 19.176270,53.660156 C 17.809570,53.660156 16.701660,52.552246 16.701660,51.185547 L 16.701660,19.621582 C 16.701660,18.255371 17.809570,17.146973 19.176270,17.146973 Z">
						<GeometryDrawing.Pen>
							<Pen DashCap="Flat" Thickness="3.125000" Brush="#ff4b4b4b" LineJoin="Round"/>
						</GeometryDrawing.Pen>
					</GeometryDrawing>
					<GeometryDrawing Brush="#ff7e7e7e" Geometry="F1 M 7.494629,19.461426 C 15.969238,38.050293 30.320801,33.676270 30.457520,33.676270 L 30.457520,27.525391 L 38.727051,36.985352 L 30.389160,45.772949 L 30.389160,39.553711 C 30.389160,39.553711 10.501953,44.200684 7.494629,19.461426 Z">
						<GeometryDrawing.Pen>
							<Pen DashCap="Flat" Thickness="3.125000" Brush="#ff323232" StartLineCap="Round" EndLineCap="Round" LineJoin="Round"/>
						</GeometryDrawing.Pen>
					</GeometryDrawing>
				</DrawingGroup.Children>
			</DrawingGroup>
		</DrawingImage.Drawing>
	</DrawingImage>

	<DrawingImage x:Key="Paste">
		<DrawingImage.Drawing>
			<DrawingGroup>
				<DrawingGroup.Children>
					<GeometryDrawing Brush="#ffb2b2b2" Geometry="F1 M 4.005859,7.713867 L 34.249512,7.713867 C 35.637695,7.713867 36.762695,8.909180 36.762695,10.384277 L 36.762695,44.451660 C 36.762695,45.926758 35.637695,47.122559 34.249512,47.122559 L 4.005859,47.122559 C 2.617676,47.122559 1.492676,45.926758 1.492676,44.451660 L 1.492676,10.384277 C 1.492676,8.909180 2.617676,7.713867 4.005859,7.713867 Z">
						<GeometryDrawing.Pen>
							<Pen DashCap="Flat" Thickness="2.984958" Brush="#ff4b4b4b" LineJoin="Round"/>
						</GeometryDrawing.Pen>
					</GeometryDrawing>
					<GeometryDrawing Brush="#ffcbcbcb" Geometry="F1 M 4.456055,17.377930 L 26.019531,11.200195 L 33.826172,38.452148 L 12.263184,44.629395 L 4.456055,17.377930 Z">
						<GeometryDrawing.Pen>
							<Pen DashCap="Flat" Thickness="1.155799" Brush="#ff4b4b4b" LineJoin="Round"/>
						</GeometryDrawing.Pen>
					</GeometryDrawing>
					<GeometryDrawing Brush="#ff7e7e7e" Geometry="F1 M 20.561035,28.525879 C 29.035645,47.114746 43.387207,42.740723 43.523926,42.740723 L 43.523926,36.589844 L 51.793457,46.499512 L 43.455566,54.837402 L 43.455566,48.618164 C 43.455566,48.618164 23.568359,53.265625 20.561035,28.525879 Z">
						<GeometryDrawing.Pen>
							<Pen DashCap="Flat" Thickness="3.125000" Brush="#ff323232" StartLineCap="Round" EndLineCap="Round" LineJoin="Round"/>
						</GeometryDrawing.Pen>
					</GeometryDrawing>
					<GeometryDrawing Brush="#ff7e7e7e" Geometry="F1 M 10.539551,1.809570 L 27.403320,1.809570 C 29.310547,1.809570 30.856934,3.355957 30.856934,5.263184 L 30.856934,7.211914 C 30.856934,9.119141 29.310547,10.665527 27.403320,10.665527 L 10.539551,10.665527 C 8.632324,10.665527 7.085938,9.119141 7.085938,7.211914 L 7.085938,5.263184 C 7.085938,3.355957 8.632324,1.809570 10.539551,1.809570 Z">
						<GeometryDrawing.Pen>
							<Pen DashCap="Flat" Thickness="3.619420" Brush="#ff4b4b4b" LineJoin="Round"/>
						</GeometryDrawing.Pen>
					</GeometryDrawing>
				</DrawingGroup.Children>
			</DrawingGroup>
		</DrawingImage.Drawing>
	</DrawingImage>
</ResourceDictionary>